package com.xzz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.xzz.domain.MessageBucksms;
import com.xzz.mapper.MessageBucksmsMapper;
import com.xzz.service.IMessageBucksmsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xzz
 * @since 2022-08-30
 */
@Service
public class MessageBucksmsServiceImpl extends ServiceImpl<MessageBucksmsMapper, MessageBucksms> implements IMessageBucksmsService {

    @Autowired
    private MessageBucksmsMapper messageBucksmsMapper;

    @Override
    public List<Long> findAll() {
        return messageBucksmsMapper.findAll();
    }

    @Override
    public MessageBucksms getBuckByPhone(String phone) {
        EntityWrapper<MessageBucksms> wrapper = new EntityWrapper<>();
        wrapper.eq("phone", phone);
        MessageBucksms messageBucksms = selectOne(wrapper);
        return messageBucksms;
    }
}
